#include <iostream>

#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::vector;

// 工资计算

int main(int argc, char **argv)
{
	int T = 0;
	cin >> T;
	int S = 0;
	if (T <= 3500)    S = T;
	else if (3500 < T && T <= 3500 + 1455)
		S = 3500 + (int)((T - 3500) / 0.97f);
	else if (3500 + 1455 < T && T <= 3500 + 1455 + 2700)
		S = 3500 + 1500 + (int)((T - 3500 - 1455) / 0.9f);
	else if (3500 + 1455 + 2700 < T && T <= 3500 + 1455 + 2700 + 3600)
		S = 3500 + 4500 + (int)((T - 3500 - 1455 - 2700) / 0.8f);
	else if (3500 + 1455 + 2700 + 3600 < T && T <= 3500 + 1455 + 2700 + 3600 + 19500)
		S = 3500 + 9000 + (int)((T - 3500 - 1455 - 2700 - 3600) / 0.75f);
	else if (3500 + 1455 + 2700 + 3600 + 19500 < T && T <= 3500 + 1455 + 2700 + 3600 + 19500 + 14000)
		S = 3500 + 35000 + (int)((T - 3500 - 1455 - 2700 - 3600 - 19500) / 0.7f);
	else if (3500 + 1455 + 2700 + 3600 + 19500 + 14000 < T && T <= 3500 + 1455 + 2700 + 3600 + 19500 + 14000 + 16250)
		S = 3500 + 55000 + (int)((T - 3500 - 1455 - 2700 - 3600 - 19500 - 14000) / 0.65f);
	else
		S = 3500 + 80000 + (int)((T - 3500 - 1455 - 2700 - 3600 - 19500 - 14000 - 16250) / 0.55f);
	cout << S << endl;
	//system("pause");
	return 0;
}